<template>
  <div v-if="!!data" class="total-container">
    <div class="box-container">
      <div class="item-box">
        <div class="title">{{ data[0].xm }}</div>
        <div class="value">
          <div class="num">
            <CountTo :startVal="0" :endVal="+data[0].sz" :duration="1200" separator=""></CountTo>
          </div>
          <div class="unit">{{ data[0].unit }}</div>
        </div>
      </div>
    </div>
    <div class="box-container">
      <div class="item-box">
        <div class="title">{{ data[1].xm }}</div>
        <div class="value">
          <div class="num">
            <CountTo :startVal="0" :endVal="+data[1].sz" :duration="1200" separator=""></CountTo>
          </div>
          <div class="unit">{{ data[1].unit }}</div>
        </div>
      </div>
      <div class="item-box">
        <div class="title">{{ data[2].xm }}</div>
        <div class="value">
          <div class="num">
            <CountTo :startVal="0" :endVal="+data[2].sz" :duration="1200" separator=""></CountTo>
          </div>
          <div class="unit">{{ data[2].unit }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { getLbData, getXjfdmslxs } from '@/api/cultureTuorism'
import CountTo from 'vue-count-to'
export default {
  name: 'travelAgency',
  data() {
    return {
      data: null
    }
  },
  components: {
    CountTo
  },
  mounted() {
    this.getData()
  },
  methods: {
    async getData() {
      const res = await getLbData('全市旅行社')
      this.data = res.result.slice(1)
    }
  }
}
</script>
<style lang="scss" scoped>
.total-container {
  .box-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    .item-box {
      width: 199px;
      height: 76px;
      background: url('../../../img/left-row2-icon1.png') no-repeat center center;
      background-size: 100% 100%;
      text-align: center;
      padding-top: 15px;
      .title {
        font-family: MicrosoftYaHeiUI;
        font-size: 16px;
        color: #ffffff;
        line-height: 16px;
        text-align: center;
        font-style: normal;
        text-transform: none;
      }
      .value {
        display: flex;
        justify-content: center;
        align-items: baseline;
        margin-top: 10px;
      }
      .num {
        font-family: YouSheBiaoTiHei;
        font-size: 24px;
        color: #16fdf5;
        line-height: 24px;
        text-align: center;
        font-style: normal;
        text-transform: none;
      }
      .unit {
        font-family: MicrosoftYaHeiUI;
        font-size: 14px;
        color: #fefefe;
        line-height: 14px;
        text-align: center;
        font-style: normal;
        text-transform: none;
        margin-left: 4px;
      }
    }
  }
}
</style>
